<template>
  <div>我是子组件</div>
  <ul>
    <li>{{ count }}</li>
    <li>{{ obj }}</li>
  </ul>
  <button @click="change">修改父组件变量</button>
</template>

<script>
export default {
  props: {
    count: {
      type: Number,
      default: 0
    },
    obj: {
      type: Object,
      default: () => ({})
    }
  },
  setup (props, { emit }) {
    console.log('123', props)
    console.log('456', emit)
    const change = () => {
      emit('chang-list', Math.random() * 100 + 1)
    }
    return { change }
  }
}
</script>

<style lang="scss" scoped>
</style>
